<template>
  <div>
    <h1>购物车</h1>

    <input type="text" v-model="projectName" />
  </div>
</template>

<script>
import { mapState } from "vuex";

export default {
  // computed: {
  //   ...mapState(["projectName"]),
  // },

  computed: {
    projectName: {
      get() {
        return this.$store.state.projectName;
      },
      set(value) {
        // 提交突变
        this.$store.commit("change", value);
      },
    },
  },
};
</script>
